package elsim.events;

import java.util.LinkedList;
import java.util.Queue;

public class EventQueue {
  private static EventQueue instance = new EventQueue();

  public static EventQueue getEventQueue() {
    return instance;
  }

  private final Queue<Event> events = new LinkedList<Event>();

  private EventQueue() {
  }

  public Event accept() {
    return events.poll();
  }

  public boolean isEmpty() {
    return events.isEmpty();
  }

  public Event peek() {
    return events.peek();
  }

  public void queueEvent(Event event) {
    events.add(event);
  }

  public void reset() {
    events.clear();
  }
}
